class Solution:
    richer = [[1, 0], [2, 1], [3, 1], [3, 7], [4, 3], [5, 3], [6, 3]]
    quiet = [3, 2, 5, 4, 6, 1, 7, 0]
    n = len(quiet)
    g = [[] for _ in range(n)]
    for r in richer:
        g[r[1]].append(r[0])

      
